<?php
class ReportsController extends BaseController {
	
	public function __construct() {
		parent::__construct();
	}
	
	public function sales(){
		
		$this->view->template('pages/reports/salesReport');
	}
	
	public function complaint(){
	
		$this->view->template('pages/reports/complaintsReport');
	}
	
	public function getSales(){
		$reportsService = new ReportsService();
		
		$filerDate = $this->post('dateFilter');
		
		$this->view->setDisplay('salesResult', $reportsService->getSales($filerDate));
		
		$this->view->template('components/salesReportResult');
	}
	
	public function getInventory(){
		$reportsService = new ReportsService();
		$this->view->setDisplay('inventoryResult', $reportsService->getInventory());
		$this->view->template('pages/reports/inventoryReport');
	}
	
	public function getComplaint(){
		$reportsService = new ReportsService();
	
		$filerDate = $this->post('dateFilter');
	
		$this->view->setDisplay('complaintResult', $reportsService->getComplaint($filerDate));
	
		$this->view->template('components/complaintReportResult');
	}
	
	
	
}